home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 849 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: alt.msdos.programmer,comp.lang.c
  4. Subject: Re: Two C problems
  5. Date: Tue, 09 Jan 96 16:47:44 GMT
  6. Organization: none
  7. Message-ID: <821206064snz@genesis.demon.co.uk>
  8. References: <4cojnn$rgd@lugb.latrobe.edu.au> <4cp82k$gsq@cloner3.netcom.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4cp82k$gsq@cloner3.netcom.com>
  15.            cfoster1@ix.netcom.com(Cameron "Cameron Foster " writes:
  16.  
  17. >Actually, the "damn language" IS working sensibly and predictably! Read
  18. >up on C escape sequences. 
  19.  
  20. :-)
  21.  
  22. >int i = 27;     /* i has the decimal value of 27 */
  23.  
  24. OK.
  25.  
  26. >int i = \27;    /* i has the decimal value of 23 (\27 is the octal */  
  27. >                /* representation of decimal 23) */
  28.  
  29. No, that is illegal. For octal you write 027 or '\27'
  30.  
  31. >int i = \x27    /* i has the decimal value of 39 */
  32.  
  33. Similarly here you must have 0x27 or '\x27'
  34.  
  35. -- 
  36. -----------------------------------------
  37. Lawrence Kirby | fred@genesis.demon.co.uk
  38. Wilts, England | 70734.126@compuserve.com
  39. -----------------------------------------
  40.